package com.wondertek.service.sdk.iotdh.constant;

public enum MsgType {
    //分为四大类 1、alarm  2、error 3、events  4、note
    //error四个有一个重复 events只有一个 note有四个
    CrossRegionDetection("CrossRegionDetection",1),
    WanderDetection("WanderDetection",1),
    videoMotion("videoMotion",1),
    CrossLineDetection("CrossLineDetection",1),
    videoBlind("videoBlind",1),
    AlarmLocal("AlarmLocal",1),
    OverLimitProtection("OverLimitProtection",1),
    WaterLeakage("WaterLeakage",1),
//    AlarmInputSourceSignal("AlarmInputSourceSignal",1),
    SensorAbnormal("SensorAbnormal",1),
    Intrusion("Intrusion",1),
    TiltAlarm("TiltAlarm",1),
    ShockAlarm("ShockAlarm",1),
    OverTemperatureAlarm("OverTemperatureAlarm",1),
    DevShiftAlarm("DevShiftAlarm",1),
    smdHuman("smdHuman",1),
    smdVehicle("smdVehicle",1),
    smdAnimal("smdAnimal",1),
    smdHumanAndVehicle("smdHumanAndVehicle",1),
    alarmLocal("alarmLocal",1),
    Panic("Panic",1),
    storageAbnormal("storageAbnormal",1),
    storageNotExist("storageNotExist",1),


    storageLowSpace("storageLowSpace",2),
    storageFailure("storageFailure",2),
    rtFaceDetect("rtFaceDetect",3),
    offline("offline",4),//自定义的
    online("online",4),//自定义的
    ManualTest("ManualTest",4),
    AlarmOutput("AlarmOutput",4),
    AlarmInputSourceSignal("AlarmInputSourceSignal",4),
    add("add",4),//自定义的
    delete("delete",4);//自定义的

    private final String msgType;
    private final Integer msgCode;

    // 私有构造函数
    MsgType(String msgType, Integer msgCode) {
        this.msgType = msgType;
        this.msgCode = msgCode;
    }

    // 便利方法
    public static Integer valueOfName(String msgType) {
        for (MsgType day : MsgType.values()) {
            if (day.msgType.equalsIgnoreCase(msgType)) {
                return day.msgCode;
            }
        }
        return 99;
    }
}